1. Technical Field
The present invention relates to network interfacing and more particularly, to methods and systems for transferring data between a host system memory and a buffer memory in a network interface device configured for accessing Ethernet media.
2. Background Art
Network interface devices handle packets of data for transmission between a host computer and a network communications system, such as a local area network. The host computer may be implemented as a client station, a server, or a switched hub. One primary function of the network interface device is to buffer data to compensate for timing discrepancies between the clock domain of the host computer and the clock domain of the network.
Network interface devices typically include a first in, first out (FIFO) buffer memory for storing transmit and receive data, where the transmit data is stored in a transmit FIFO prior to transmission on the network media by the MAC, and receive data is stored in a receive FIFO by the MAC prior to transfer to the host computer via the host computer bus interface.
One disadvantage with the use of a FIFO for a transmit buffer or a receive buffer is the increased latency encountered during the buffering process. The latency of the network interface device is the time delay between the time that a data frame is supplied to the network interface device and the time the data is transmitted on the network media, or vice versa.
An additional problem caused by the buffering of data between the clock domain of the host computer and the clock domain of the network interface device is buffer overflow or underflow. For example, buffer overflow can occur when the time domains between the host bus and the network media are uncontrollable to the extent that data is stored in the buffer at a rate faster than the data can be removed, resulting in an overflow situation. Conversely, underflow occurs if data is removed from the FIFO buffer faster than the data can be supplied.
Hence, the non-synchronous relationship between the host bus clock domain and the network clock domain have required the necessity of FIFO buffers to compensate for timing discrepancies between the host computer and the network.
Network interface devices configured for transferring data between host system memory and the FIFO buffer using DMA transfers have typically used descriptor entries, stored in system memory, to provide information needed by the DMA management unit on the network interface device to transfer either transmit data or receive data between the system memory and the network interface device. In particular, the descriptor entries are typically organized as ring structures in system memory, and include one descriptor ring for transmit data and another descriptor ring for receive data. Each descriptor entry is used to describe a single buffer. Since a frame may occupy one or more buffers, multiple descriptor entries may be used to identify multiple buffers storing data for a given data frame. Hence, for each transfer of frame data (i.e., packet data), the network interface device needs to perform two DMA transfers from system memory, namely one DMA transfer to obtain descriptor information related to the frame data, and a second DMA transfer for the actual stored frame data. Hence, the network interface device relied upon software drivers, executable by the host processor, to maintain descriptor data in system memory related to transmit and receive data.
One disadvantage in prior implementations of descriptor-based buffer management schemes was that the network interface device needed to regularly poll the system memory locations storing the descriptor information in order to determine whether the descriptor entries have changed. If the network interface device detected a change in the descriptor entries stored in the system memory, the network interface device would recognize that another transfer of data was necessary. For example, a change in the transmit descriptor entries would cause the network interface device to initiate a transmit descriptor entry access in order to transfer transmit data from the system memory to the network interface device for transmission on the network medium.
Hence, the network interface device conventionally would periodically poll the current receive and transmit descriptor entries in order to ascertain "ownership," namely whether the driver software executed by the host computer was responsible for updating the descriptor entries, or whether the network interface device needed to access the descriptor entries in order to perform a data transfer. The periodic polling of the current receive and transmit descriptor entries was used particularly if there was no network channel activity, and there was no pre- or post-receive or pre- or post-transmit activity being performed by the network interface device.
This polling operation, however, reduced the throughput of the host bus, especially if the receive or transmit descriptor entries had not been updated. In addition, the system driver would need to fetch the descriptor information to determine whether data was released, followed by changing the descriptor at the same location. Hence, the multiple accesses by either the software driver or the network interface device from the same system memory location would substantially reduce the throughput of the host bus.